/**
 * CompanyIndustry 业务逻辑实现类
 * @author yanwl
 * @date 2014-09-28
 */
package com.chnbst.bstyun.service.impl;

import java.util.List;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.chnbst.bstyun.core.base.BaseService;
import com.chnbst.bstyun.core.common.helper.DaoHelper;
import com.chnbst.bstyun.model.pojo.CompanyIndustry;
import com.chnbst.bstyun.service.CompanyIndustryService;

@Transactional
@Service
public class CompanyIndustryServiceImpl extends BaseService implements CompanyIndustryService {
	
	//声明日志对象 logback
	private final static Logger logger = LoggerFactory.getLogger(CompanyIndustryServiceImpl.class);
	private final static String nameSpace = "com.chnbst.bstyun.mapper.CompanyIndustryMapper";
	
	@Transactional(propagation=Propagation.REQUIRED,readOnly=false)
	@Override
	public boolean deleteCompanyIndustry(Integer companyIndustryId) {
		return DaoHelper.delete(nameSpace, "deleteCompanyIndustry", companyIndustryId);
	}
	
	@Transactional(propagation=Propagation.REQUIRED,readOnly=false)
	@Override
	public boolean insertCompanyIndustry(CompanyIndustry companyIndustry) {
		return DaoHelper.insert(nameSpace, "insertCompanyIndustry", companyIndustry);
	}
	
	@Transactional(propagation=Propagation.REQUIRED,readOnly=false)
	@Override
	public boolean updateCompanyIndustry(CompanyIndustry companyIndustry) {
		return DaoHelper.update(nameSpace, "updateCompanyIndustry", companyIndustry);
	}
	
	@Transactional(propagation=Propagation.REQUIRED,readOnly=true)
	@Override
	public CompanyIndustry selectCompanyIndustryByCompanyIndustryId(Integer companyIndustryId) {
		return (CompanyIndustry)DaoHelper.query(nameSpace, "selectCompanyIndustryByCompanyIndustryId", companyIndustryId);
	}
	
	@SuppressWarnings("unchecked")
	@Transactional(propagation=Propagation.REQUIRED,readOnly=true)
	@Override
	public List<CompanyIndustry> selectCompanyIndustries() {
		return (List<CompanyIndustry>)DaoHelper.list(nameSpace, "selectCompanyIndustries", null);
	}
}
